<template>
	<view class="page">
		<view  class="zy-address-item" style="margin: 0rpx auto;margin-top: 50rpx;background-color: #FFFFFF;width: 600rpx;border-radius: 8rpx;">
			<uni-list :border="false">
				<uni-list-item :isBorder="false" :clickable="true" @click="print(1)" :extraIcon="{color: '#0ac3e8',size: 80,type: 'iconwenjian'}" showExtraIcon="true" >
					<view  class="zy-phone" >
						<view class="slot-box">
							<text class="slot-text" style="font-size: 40rpx;font-weight: 800;">微信聊天文档打印</text>
						</view>
						<text class="uni-list-item__content-note" style="margin-top: 20rpx;">支持word、Excel、ppt、PDF等文件</text>
					</view>
				</uni-list-item>
				<view class="" style="background-color: #eeeeee;height: 30rpx;"></view>
				<uni-list-item :isBorder="false" :clickable="true" @click="print(2)" :extraIcon="{color: '#ff00ff',size: 80,type: 'iconzhaopian'}"  showExtraIcon="true" >
					<view  class="zy-phone" >
						<view class="slot-box">
							<text class="slot-text" style="font-size: 40rpx;font-weight: 800;">手机相册打印</text>
						</view>
						<text class="uni-list-item__content-note" style="margin-top: 20rpx;">手机相册打印</text>
					</view>
				</uni-list-item>
				<view class="" style="background-color: #eeeeee;height: 30rpx;"></view>
				<uni-list-item :isBorder="false" :clickable="true" @click="print(3)" :extraIcon="{color: '#0ac3e8',size: 80,type: 'icondayinfuyin-'}"  showExtraIcon="true" >
					<view  class="zy-phone" >
						<view class="slot-box">
							<text class="slot-text" style="font-size: 40rpx;font-weight: 800;">文件复印</text>
						</view>
						<text class="uni-list-item__content-note" style="margin-top: 20rpx;">将文件拍成照片打印</text>
					</view>
				</uni-list-item>
				<view class="" style="background-color: #eeeeee;height: 30rpx;"></view>
				<uni-list-item :isBorder="false" :clickable="true" @click="print(4)" :extraIcon="{color: '#ff5500',size: 80,type: 'iconyouhuiquan'}"  showExtraIcon="true" >
					<view  class="zy-phone" >
						<view class="slot-box">
							<text class="slot-text" style="font-size: 40rpx;font-weight: 800;">量大优惠预约</text>
						</view>
						<text class="uni-list-item__content-note" style="margin-top: 20rpx;">量大优惠预约，越多越实惠</text>
					</view>
				</uni-list-item>
			</uni-list>
		</view>
	</view>
</template>

<script>
	import uniList from '@/components/uni-list/uni-list.vue'
	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
	import zyworkIcon from '@/components/zywork-icon/zywork-icon.vue'
	import * as ResponseStatus from '@/common/response-status.js'
	import {
		BASE_URL,
		USER_TOKEN_KEY,
		DEFAULT_HEADICON,
		showSuccessToast,
		showInfoToast,
		doGet,
		doPostJson,
		nullToStr,
		FRONT_BASE_URL,
		LOCAL_FILE_STORAGE,
		USER_SCHOOL
	} from '@/common/util.js'
	export default {
		components: {
			uniList,
			uniListItem,
			zyworkIcon
		},
		data() {
			return {
				location:"请选择你的学校",
				frontBaseUrl: FRONT_BASE_URL,
				schoolIndex:0,
				isShow:false,
				arraySchool:[],
				extraIcon: {
					color: '#0ac3e8',
					size: 80,
					type: 'iconwenjian'
				},
				shopId:0,
				shopData:{}
			};
		},
		onLoad(data) {
			if(data.id){
				this.shopId = data.id
				doGet("/graphic-preferential/any/qr/"+this.shopId, {}, {}, true).then(response => {
					let [error, res] = response;
					if (res.data.code === ResponseStatus.OK) {
						this.shopData =res.data.data
					} else {
						showInfoToast(res.data.message);
					}
				}).catch(err => {
					console.log(err)
				})
			}
		},
		onShow() {
		},
		methods:{
			print(type){
				if(type==4){
					 var navData = JSON.stringify(this.shopData); // 这里转换成 字符串
					uni.navigateTo({
						url:"/pages/print/print-info?navData="+navData
					})
				}else {
					uni.navigateTo({
						url:"/pages/print/print?id="+this.shopId+"&type="+type
					})	
				}
				
			}
		}
	}
</script>

<style lang="scss">
	@import '@/common/zywork-main.scss';
	page{
		width: 100%;
		background-color: #eeeeee;
		height: 100%;
		padding-top: 30rpx;
	}
	
	.zy-phone{
		@include flex-center-column;
	}
	
	.list-item-column{
		background-color: #00AA7F;
		@include flex-center-column;
		
		view{
			color: #FFFFFF;
		}
		view:nth-child(1){
			padding: 15rpx 30rpx;
			font-size: $font-lg;
		}
		view:nth-child(2){
			@include flex-center-row;
			padding: 15rpx 0rpx;
		}
		view:nth-child(3){
			padding: 15rpx 30rpx;
			font-size: $font-lg;
		}
	}
	.zy-address-item{
		margin: 0rpx $padding-left-right;
		padding: 25rpx 0rpx;
		margin-bottom: 30rpx;
		width: 690rpx;
		// height: 250rpx;
		background-color: #00AA7F;
		border-radius: 35rpx;
	}
	
	.slot-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		
	}
	.slot-text{
		color: #3b4144;
		font-size: $font-base;
	}
</style>
